package com.heima.model.admin.dtos;

import com.heima.common.util.constants.RegexPatterns;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


@Data
public class AdUserLoginDto {

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    private String name;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Length(min = 2,max = 16,message = "密码只能为2-16位")
    private String password;

    @Pattern(regexp = RegexPatterns.EMAIL_REGEX,message = "电子邮件格式不正确")
    private String  email;
}
